<?php

//输出错误日志
function elog ($obj = null, $path = null)
{
    if(is_array($obj) || is_object($obj))
        $obj = print_r($obj,1);
    elseif($obj === null) {
        if(!isset($GLOBALS["logIndex"])) $GLOBALS["logIndex"] = 1;
        $obj = 'LOG--------------- '.$GLOBALS["logIndex"];
        $GLOBALS["logIndex"]++;
    }
    $path ? error_log($obj, 3, $path) : error_log($obj);
}